Skip to content

Normalize plugins Certificates output#1498

Merged
Schamper merged 31 commits intofox-it:mainfrom
william-billaud:normalize_certlog_output
Jan 16, 2026
Merged

Normalize plugins Certificates output#1498
Schamper merged 31 commits intofox-it:mainfrom
william-billaud:normalize_certlog_output

Conversation

@william-billaud
Copy link
Contributor

Following #1415

Normalize serial_number output to string format (hex), which is the common way serial number are shown (e.g by browser or openssl).
Rename some field for consistency between plugins that manipu.

cc @JSCU-CNI

@JSCU-CNI
Copy link
Contributor

Thanks for the PR, this is a good step in normalizing certificate fields across the project.

Normalize serial_number output to string format (hex), which is the common way serial number are shown (e.g by browser or openssl).

Unfortunately serial numbers can also be negative (signed) integers (4.1.2.2, https://www.ietf.org/rfc/rfc2459.txt, -set_serial n in OpenSSL), which is difficult to properly communicate in hex notation (-1337 -> FA C7).

We prefer the notation of serial numbers as integers, as most cryptography libraries do by default as well (BoringSSL, asn1crypto, pyca/cryptography).

Perhaps we can add two fields to accommodate both use cases, serial_number and serial_hex or serial_number_hex.

@Schamper
Copy link
Member

@william-billaud I agree with @JSCU-CNI here. Even though it's only a data representation problem of the same data, I can see the value of having a readily available/searchable hex variant too.

Maybe opt for serial_number_hex?

which is difficult to properly communicate in hex notation (-1337 -> FA C7).

Even more so because Python by default will make that -0x539.

Fix documentation related to format fingerprint
Add tests related to negative serial number processing
@william-billaud
Copy link
Contributor Author

i have added a test with a negative serial number + add serial_number and serial_number_hex field for both plugins.

@william-billaud william-billaud changed the title Normalize plugins Certificates outputfi Normalize plugins Certificates output Jan 15, 2026
william-billaud and others added 7 commits January 16, 2026 13:23
william-billaud and others added 4 commits January 16, 2026 16:33
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
william-billaud and others added 11 commits January 16, 2026 16:37
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 75.55556% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.74%. Comparing base (a102b31) to head (1539031).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dissect/target/plugins/os/windows/certlog.py 71.42% 10 Missing ⚠️
dissect/target/helpers/certificate.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1498      +/-   ##
==========================================
- Coverage   80.74%   80.74%   -0.01%     
==========================================
  Files         394      394              
  Lines       34571    34614      +43     
==========================================
+ Hits        27916    27948      +32     
- Misses       6655     6666      +11     
Flag Coverage Δ
unittests 80.74% <75.55%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 16, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing william-billaud:normalize_certlog_output (1539031) with main (a102b31)

Summary

✅ 11 untouched benchmarks

@Schamper Schamper merged commit 3c63ec2 into fox-it:main Jan 16, 2026
15 of 22 checks passed
@william-billaud william-billaud deleted the normalize_certlog_output branch January 20, 2026 09:39
Matthijsy pushed a commit to Matthijsy/dissect.target that referenced this pull request Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize Windows CertLog Certificates output

3 participants